

<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="utf-8">
  <title>设置我的资料</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
 <link rel="stylesheet" href="../layuiadmin/layui/css/layui.css" th:href="@{static/layuiadmin/layui/css/layui.css}" media="all">
  <link rel="stylesheet" href="../layuiadmin/style/admin.css" th:href="@{static/layuiadmin/style/admin.css}" media="all">
</head>
<body>

  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-col-md12">
        <div class="layui-card">
          <div class="layui-card-header">设置我的资料</div>
          <div class="layui-card-body">
            
            <div class="layui-form" >
              <div class="layui-form-item">
                <label class="layui-form-label">我的角色</label>
                <div class="layui-input-inline">
                  <input type="text" name="role" id="role" th:value="${session.role}" readonly class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux">当前角色不可更改为其它角色</div>
              </div>
              <div class="layui-form-item">
                <label class="layui-form-label">邮箱</label>
                <div class="layui-input-inline">
                  <input type="text" name="email" id="email"  readonly class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux">不可修改</div>
              </div>
              <div class="layui-form-item">
                <label class="layui-form-label">用户名</label>
                <div class="layui-input-inline">
                  <input type="text" name="username" id="username" th:value="${session.name}"  readonly class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux">不可修改</div>
              </div>
 
              <div class="layui-form-item">
                <label class="layui-form-label">可用积分</label>
                <div class="layui-input-inline">
                  <input type="text" name="points" id="points"  readonly class="layui-input">
                </div>
                 <button class="layui-btn layui-btn-primary" id="recharge">充值积分</button >
              </div>
              
       
            </div>
            
          </div>
        </div>
      </div>
    </div>
  </div>

<script src="../layuiadmin/layui/layui.js"  th:src="@{static/layuiadmin/layui/layui.js}"></script>
  <script>
  layui.config({
    base: '/static/layuiadmin/'  //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'set'],function(){
    var $=layui.$
   $("#recharge").on('click',function(){
   	layer.open({
   		type:2,
   		content:"/static/pages/cao.html"
   	})
//    layer.prompt({
//formType: 0,
//title: '请输入要充值的积分数量',
//area: ['200px', '100px'] //自定义文本域宽高
//}, function(value, index, elem){
//alert(value); //得到value
//$.ajax({
//  url:"/paypal/pay",
//  type:"post",
//  data:{"value":value}
//  
//})
//layer.close(index);
//
//});
    })
    $.ajax({
      url:"/showInfo",
      type:"POST",
      dataType:"json",
      success:function(data){
        console.log(data)
        $("#email").val(data.email)
        $("#points").val(data.points)

        

      }
    })
  });
  </script>
</body>
</html>